package com.bestsoft.web.controller.flow;

import java.util.List;

import com.bestsoft.common.annotation.Log;
import com.bestsoft.common.core.domain.AjaxResult;
import com.bestsoft.common.enums.BusinessType;
import com.bestsoft.flow.domain.FlowZsDt;
import com.bestsoft.flow.service.IFlowZsDtService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.bestsoft.common.core.controller.BaseController;
import com.bestsoft.common.core.page.TableDataInfo;

/**
 * 追溯明细Controller
 *
 * @author 王识宇
 * @date 2023-08-30
 */
@RestController
@RequestMapping("/flow/zsdt")
public class FlowZsDtController extends BaseController
{
    @Autowired
    private IFlowZsDtService flowZsDtService;

    /**
     * 查询追溯明细列表
     */
    @PreAuthorize("@ss.hasPermi('flow:zsdt:list')")
    @GetMapping("/list")
    public TableDataInfo list(String qcode)
    {
        startPage();
        List<FlowZsDt> list = flowZsDtService.selectFlowZsDtList(qcode);
        return getDataTable(list);
    }

    /**
     * 修改追溯明细
     */
    @PreAuthorize("@ss.hasPermi('flow:zsdt:edit')")
    @Log(title = "追溯明细", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody FlowZsDt flowZSDt)
    {
        return toAjax(flowZsDtService.updateFlowZSDt(flowZSDt));
    }

    /**
     * 修改追溯明细 erp
     */
    @PreAuthorize("@ss.hasPermi('flow:zsdt:edit')")
    @Log(title = "追溯明细", businessType = BusinessType.UPDATE)
    @PutMapping("uptErp")
    public AjaxResult edit2(@RequestBody FlowZsDt flowZSDt)
    {

        return toAjax(flowZsDtService.updateFlowZSDtErp(flowZSDt));
    }

//    /**
//     * 修改 数量，标示时间，放射性活度 erp
//     */
//    @PreAuthorize("@ss.hasPermi('flow:zsdt:edit1')")
//    @Log(title = "追溯明细", businessType = BusinessType.UPDATE)
//    @PutMapping("uptErp1")
//    public AjaxResult edit3(@RequestBody FlowZsDt flowZSDt)
//    {
//
//        return toAjax(flowZsDtService.updateFlowOrderDtErp(flowZSDt));
//    }


}
